<% content_for :title do %>修改密码<% end %>

<%= form_for(@user, url: password_path(),method: :put , html: {:class=>"form-horizontal"}) do |f| %>

<% if @user.errors.any? %>
<div id="error_explanation">
  <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
  <ul>
  <% @user.errors.full_messages.each do |message| %>
    <li><%= message %></li>
  <% end %>
  </ul>
</div>
<% end %>

<div class="form-group">
	<%= f.label "当前密码",:class=>"col-sm-2 control-label" %>
	<div class="col-sm-4">
	<%= f.password_field :current_password,:class=>"form-control",autocomplete: "off" %>
	</div>
</div>

<div class="form-group">
	<%= f.label "新密码",:class=>"col-sm-2 control-label" %>
	<div class="col-sm-4">
	<%= f.password_field :password,:class=>"form-control",autocomplete: "off" %>
	</div>
</div>

<div class="form-group">
	<%= f.label "确认密码",:class=>"col-sm-2 control-label" %>
	<div class="col-sm-4">
	 <%= f.password_field :password_confirmation,:class=>"form-control", autocomplete: "off" %>
	</div>
</div>

<div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default btn-primary">确认修改</button>
    </div>
</div>

<% end %>